
_realname=reflex
pkgname=${_realname}
pkgver=20200715
pkgrel=1
pkgdesc="A variant of the flex fast lexical scanner"
arch=('i686' 'x86_64')
url="https://invisible-island.net/reflex"
license=('BSD')
groups=('base-devel')

# source=("${_realname}-${pkgver}.tar.gz::https://invisible-island.net/datafiles/release/${_realname}.tar.gz")
source=("${_realname}-${pkgver}.tar.gz::https://github.com/ThomasDickey/${_realname}-snapshots/archive/t${pkgver}.tar.gz")
sha256sums=('80ebbadd26e96a95cc7e4c752608c7dfec7fe9a569258a3dc5f0e4de9a36ffc7')


_src_dir=${_realname}-snapshots-t${pkgver}
_build_dir=build-${pkgver}-${MSYSTEM_CHOST}


prepare() {
  autoreconf -vfi ${_src_dir}
}

build() {
  mkdir -p ${_build_dir}
  cd ${_build_dir}
  ../${_src_dir}/configure -C
  make
}

check() {
  make -C ${_build_dir} check
}

package() {
  mkdir -p "${pkgdir}/usr/share/licenses/${pkgname}"
  cp -pv ${_src_dir}/package/debian/copyright "${pkgdir}/usr/share/licenses/${pkgname}"
  make -C ${_build_dir} DESTDIR=${pkgdir} install
}
